<template>

    <div class="common-layout">
      <el-container class="common-container">
        <el-header height="150px">
            <Header></Header>
        </el-header>
        <el-container>
          <el-aside width="200px">
            <Menu></Menu>
          </el-aside>
          
          <el-main>
           <RouterView></RouterView>
          </el-main>
        </el-container>
       
      </el-container>
    </div>

  </template>
   
  <style scoped>
  .el-header{
    background-color:rgb(44, 141, 220);
  }
  .el-aside{
    background-color: rgb(247, 247, 250);
  }
  .el-main{
    background-color: rgb(250, 247, 247);
  }
 
  .common-layout,.common-container{
    width: 100%;
    height: 100%;
  }
  </style>

<script setup>
import Header from '@/components/Header.vue';
import Menu from '@/components/Menu.vue';
import { onBeforeMount, onMounted } from 'vue';
import { useRouter } from 'vue-router';
onBeforeMount(() => {
  const router = useRouter();
  const eToken=sessionStorage.getItem('employeeData');
  const bToken=sessionStorage.getItem('businessData');
  console.log(sessionStorage.getItem('businessData'));
  if(eToken==null&&bToken==null){
    router.push('/login');
  }
});
</script>